package com.ruoyi.erp.service.impl;

import com.ruoyi.erp.domain.Person;
import com.ruoyi.erp.mapper.PersonMapper;
import com.ruoyi.erp.service.IPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 业务员Service业务层处理
 * 
 * @author ztj
 * @date 2024-08-21
 */
@Service
public class PersonServiceImpl implements IPersonService 
{
    @Autowired
    private PersonMapper personMapper;

    /**
     * 查询业务员
     * 
     * @param cPersonCode 业务员主键
     * @return 业务员
     */
    @Override
    public Person selectPersonByCPersonCode(String cPersonCode)
    {
        return personMapper.selectPersonByCPersonCode(cPersonCode);
    }

    /**
     * 查询业务员列表
     * 
     * @param person 业务员
     * @return 业务员
     */
    @Override
    public List<Person> selectPersonList(Person person)
    {
        return personMapper.selectPersonList(person);
    }

    /**
     * 新增业务员
     * 
     * @param person 业务员
     * @return 结果
     */
    @Override
    public int insertPerson(Person person)
    {
        return personMapper.insertPerson(person);
    }

    /**
     * 修改业务员
     * 
     * @param person 业务员
     * @return 结果
     */
    @Override
    public int updatePerson(Person person)
    {
        return personMapper.updatePerson(person);
    }

    /**
     * 批量删除业务员
     * 
     * @param cPersonCodes 需要删除的业务员主键
     * @return 结果
     */
    @Override
    public int deletePersonByCPersonCodes(String[] cPersonCodes)
    {
        return personMapper.deletePersonByCPersonCodes(cPersonCodes);
    }

    /**
     * 删除业务员信息
     * 
     * @param cPersonCode 业务员主键
     * @return 结果
     */
    @Override
    public int deletePersonByCPersonCode(String cPersonCode)
    {
        return personMapper.deletePersonByCPersonCode(cPersonCode);
    }
}
